VER =	1.0.0
CFLAGS = -g -O0 -Wall -Wstrict-prototypes -Wmissing-prototypes		\
	 -Wpointer-arith -Wreturn-type -Wcast-qual -Wwrite-strings	\
	 -Wswitch -Wshadow -Wcast-align -Wunused-parameter		\
	 -Wchar-subscripts -Winline -Wnested-externs -Wredundant-decls	\
	 -Wformat -Werror \
	 -I../../
DEFINES = -D_GNU_SOURCE -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 \
	-DPACKAGE_VERSION="\"$(VER)\""

OBJS =	\
	muddog.o
DIST_FILES= \
	muddog.8 \
	muddog_example.conf \
	Makefile *.[ch]

all: muddog

muddog: $(OBJS)
	gcc $(CFLAGS) $(DEFINES) -o muddog $(OBJS)

.c.o:
	gcc $(CFLAGS) $(DEFINES) -c -o $@ $<

tar:
	mkdir -p /tmp/muddog-$(VER) && \
	    cp $(DIST_FILES) /tmp/muddog-$(VER)/ && \
	    cd /tmp && \
	    tar cvf muddog-$(VER).tar muddog-$(VER)/ && \
	    gzip muddog-$(VER).tar

clean:
	rm -f muddog $(OBJS)
